PATHMac OS 8 and 9 Developer Documentation > Interapplication Communication > AppleScript for Scripters >

AppleScript Language Guide

   

Command Definitions

The sections that follow are in alphabetical order by command name and provide definitions for both AppleScript commands and standard application commands. The general features of these types of commands are described in Types of Commands. The command type is noted in the brief command description at the beginning of each definition.

Table 4-1 summarizes the standard application-only commands described in this chapter and provides links to sections that describe the commands in detail. Table 4-2 does the same for the AppleScript commands defined in this chapter. Some of the commands in Table 4-2 are also implemented as application commands.

For more information about the standard scripting addition commands distributed with AppleScript, see the AppleScript section of the Mac OS Help Center. For definitions of commands provided by other scripting additions, see the documentation for those scripting additions.

The application commands defined in this chapter are standard application commands supported by most scriptable applications. The definitions in this chapter describe how these commands work in most applications. Individual applications can extend or change the way the standard application commands work.

Application dictionaries list application commands by suites. Each suite defines the Apple event constructs (object class definitions, descriptor types, and so on) needed for performing a particular type of scriptable activity. The suite categories include the Standard suite, the Internet suite, the Text suite, and so on. Different applications may support different commands in the Standard suite, but all support the Open, Print, Quit, Run, and Reopen commands, which were formerly in a separate Required suite.

Note

If an application supports just the four required commands it is not considered scriptable and it doesn't need a dictionary. If it supports the required commands in the standard way and supports additional commands as well, it needn't include the required commands in its dictionary. In either case, the required commands will be available to scripters (they will compile and run with the Script Editor).

Many applications also define their own suite of more specialized commands. The application's dictionary provides definitions of all commands supported by the application (with the exception noted above for the four required commands). Check the appropriate application dictionary before using application commands. You can view the dictionary of an application or scripting addition by dropping its icon on the Script Editor's icon, or by opening the application or scripting addition with the Script Editor's Open Dictionary command.

Table 4-1   Standard application-only commands

Command

Description

Must be supported by all applications

Launch Launches an application without invoking its standard startup procedures. This command is handled differently than other commands in this table. Refer to the definition for details.
Open Opens one or more files.
Print Prints one or more objects.
Quit Terminates an application.
Reopen Brings an already-open application to the front and re-invokes its standard startup procedures.
Run Launches an application and invokes its standard startup procedures.

Commonly supported by scriptable applications

Close Closes one or more objects.
Count Counts elements of a particular class in an object.
Delete Deletes one or more objects.
Duplicate Copies an object or objects to a new location.
Exists Determines if an object exists.
Get Returns the value of an object.
Make Creates a new object.
Move Moves an object or objects.
Save Saves an object to a file.
Set Assigns a value to an object.

Table 4-2 lists the AppleScript commands defined in this chapter. Some of these commands are also implemented as.application commands

Table 4-2   AppleScript and application commands

Command

Description

Copy Assigns a value to a variable or object.
Count Counts the elements of a composite value.
Get Returns the value of an expression.
Run Executes statements other than handler and property definitions in a script object definition.
Set Assigns a value to a variable or an object.

Another AppleScript command, the Error command, is described in Try Statements.


© 1999 Apple Computer, Inc. – (Last Updated 21 May 99)